﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;

namespace Yugi.Client.ViewModel
{
    public partial class MainServerHandler
    {
        void ProcessMainServer_L_Recurrence_Table_OK(object[] param)
        {
            this.Room_Model.Presenter.Do(ClientMSG.RecurrenceTable_OK, param);
        }
        void ProcessMainServer_L_Login_OK(object[] param)
        {
            this.Login_Model.Presenter.Do(ClientMSG.Login_OK, param);
        }
        void ProcessMainServer_L_Update_Friend_OK(object[] param)
        {
            if(this.External_Model.Presenter==null)
                this.Login_Model.Presenter.Do(ClientMSG.Update_Friend_OK, param);
            else
                this.External_Model.Presenter.Do(ClientMSG.Update_Friend_OK, param);
        }
        void ProcessMainServer_L_Update_Friend_Off_OK(object[] param)
        {
            if (this.External_Model.Presenter == null)
                this.Login_Model.Presenter.Do(ClientMSG.Update_Friend_Off_OK, param);
            else
                this.External_Model.Presenter.Do(ClientMSG.Update_Friend_Off_OK, param);
        }
        void ProcessMainServer_L_Login_Failed(object[] param)
        {
            this.Login_Model.Presenter.Do(ClientMSG.Login_Error, param);
        }
        void ProcessMainServer_L_Get_List_Table(object[] param)
        {

        }
        void ProcessMainServer_L_CreateTable_OK(object[] param)
        {
            this.Room_Model.Presenter.Do(ClientMSG.CreateTable_OK, param);
        }
        void ProcessMainServer_L_JoinTable_OK(object[] param)
        {
            this.Room_Model.Presenter.Do(ClientMSG.JoinTable_OK, param);
        }
        void ProcessMainServer_L_OutTable_OK(object[] param)
        {
            this.Room_Model.Presenter.Do(ClientMSG.OutTable_OK, param);
        }
        void ProcessMainServer_L_Update_OK(object[] param)
        {
            this.Deck_Model.Presenter.Do(ClientMSG.UpdateCard_OK, param);
        }
        void ProcessMainServer_L_Update_Error(object[] param)
        {
            this.Deck_Model.Presenter.Do(ClientMSG.UpdateCard_Error, param);
        }
        void ProcessMainServer_L_CreateRoom_OK(object[] param)
        {
            this.External_Model.Presenter.Do(ClientMSG.CreateRoom_OK, param);
        }
        void ProcessMainServer_L_JoinRoom_OK(object[] param)
        {
            this.External_Model.Presenter.Do(ClientMSG.JoinRoom_OK, param);
        }
        void ProcessMainServer_L_OutRoom_OK(object[] param)
        {
            this.External_Model.Presenter.Do(ClientMSG.OutRoom_OK, param);
        }
        void ProcessMainServer_L_Update_JoinRoom_OK(object[] param)
        {
            if (Room_Model.Presenter != null)
                this.Room_Model.Presenter.Do(ClientMSG.Update_JoinRoom_OK, param);
        }
        void ProcessMainServer_L_Update_OutRoom_OK(object[] param)
        {
            if (Room_Model.Presenter != null)
                this.Room_Model.Presenter.Do(ClientMSG.Update_OutRoom_OK, param);
        }
        //chat
        void ProcessMainServer_L_Chat_Channel(object[] param)
        {
            this.ChatManager_Model.ReceiveMSG(ClientMSG.Chat_Channel, param);
        }
        void ProcessMainServer_L_Chat_OK(object[] param)
        {
            this.ChatManager_Model.ReceiveMSG(ClientMSG.Chat_OK, param);
        }

        void ProcessMainServer_L_Chat_Error(object[] param)
        {
            this.ChatManager_Model.ReceiveMSG(ClientMSG.Chat_Error, param);
        }


        //list user online
        void ProcessMainServer_L_User_On(object[] param)
        {
            this.ListOnline_Model.ReceiveMSG(ClientMSG.User_On, param);
        }

        void ProcessMainServer_L_User_Off(object[] param)
        {
            this.ListOnline_Model.ReceiveMSG(ClientMSG.User_Off, param);
        }

        void ProcessMainServer_L_User_AllOn(object[] param)
        {
            this.ListOnline_Model.ReceiveMSG(ClientMSG.User_AllOn, param);
        }

    }
}
